using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableRoomStatus
	{
		public const string Table = "RoomStatus";
		public const string RoomStatusID = "RoomStatusID";
		public const string RoomStatusName = "RoomStatusName";
	}
	
	[Serializable]
	public class BaseRoomStatus
		: IDbSessionEntity, IJsonClass
	{
		int m_RoomStatusID;
		/// <summary>
        /// 
        /// </summary>
        public int RoomStatusID
        {
            get { return m_RoomStatusID; }
            set { m_RoomStatusID = value; }
        }
		
		string m_RoomStatusName;
		/// <summary>
        /// 
        /// </summary>
        public string RoomStatusName
        {
            get { return m_RoomStatusName; }
            set { m_RoomStatusName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_RoomStatusID = reader[TableRoomStatus.RoomStatusID];
            m_RoomStatusName = reader[TableRoomStatus.RoomStatusName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableRoomStatus.RoomStatusID, PrimaryKeyType.Identity, RoomStatusID);
			writer[TableRoomStatus.RoomStatusName] = RoomStatusName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_RoomStatusID = idd;
        }
		
		public string TableName
        {
            get { return TableRoomStatus.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_RoomStatusID = hashToRead["RoomStatusID"];
			 
             m_RoomStatusName = hashToRead["RoomStatusName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["RoomStatusID"] = RoomStatusID;
			 
            hashToFill["RoomStatusName"] = RoomStatusName;
			 
        }

        #endregion
		
	}
}
